<?php
/**
 * Created by PhpStorm.
 * User: xiaofang
 * Date: 2020/12/12
 * Time: 14:57
 */

namespace app\admin\model;


use think\Db;
use think\Exception;
use think\Model;

class Agateway extends Model
{
    public function gw_id($gateway_id)
    {
        return Db::name("nyd_gateway")
            ->where("gateway_id",$gateway_id)
            ->value("id");
    }

    /**
     * 插入临时数据
     */
    public function in_ls_data($in_data)
    {
        $db_ls = Db::name("ny_linshi_data");
        try{
            $db_ls->insert($in_data);
        }catch (Exception $exception){
            return ret_com(0, 'error '.$exception->getMessage());
        }
        return ret_com();
    }
}